package com.hackordie.daos;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.authorities.User;

public class UserMapper implements RowMapper<User> {

	@Override
	public User mapRow(final ResultSet result, final int row) throws SQLException {
		User user = new User();
		user.setId(result.getInt("idUser"));
		user.setIdUser(result.getInt("idUser"));
		user.setUserName(result.getString("userName"));
		user.setUserPassword(result.getString("userPassword"));
		user.setEmail(result.getString("email"));
		user.setSigninDate(result.getDate("signinDate"));
		user.setEnabled(result.getBoolean("enabled"));
		return user;
	}

}
